package com.cy.ppj.dao.mapper.user;

import com.cy.ppj.model.domian.user.UserInfo;
import com.cy.ppj.model.dto.account.BrokerUpgradeDTO;
import com.cy.ppj.model.dto.account.BrokerUpgradeUpdateDTO;
import com.cy.ppj.model.enums.account.BrokerLevel;
import com.cy.ppj.model.query.account.BrokerUpgradeQuery;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import tk.mybatis.mapper.common.BaseMapper;

@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    /**
     * 解除用户银行卡
     *
     * @param userId
     */
    int unBindBank(@Param("userId") Long userId);

    /**
     * 通过用户ID查询经纪人等级
     *
     * @param userId
     * @return
     */
    BrokerLevel queryLevelByUserId(@Param("userId") Long userId);

    /**
     * 用户升级信息查询
     *
     * @param query
     * @return
     */
    BrokerUpgradeDTO selectBrokerUpgradeInfo(BrokerUpgradeQuery query);

    /**
     * 更新经纪人等级
     *
     * @param brokerUpgradeUpdate
     * @return
     */
    int updateBrokerLevel(BrokerUpgradeUpdateDTO brokerUpgradeUpdate);
    
    /**
     * 查询所有的处于（钻石）体验期的新用户
     * 
     * @return
     */
    List<UserInfo> selectNewUserList();

    /**
     * 批量更新用户的 new_user = 0
     * 
     * @param userIds
     */
	void updateNewUserToFalse(@Param("userIds") List<Long> userIds);
    
}
